{if $full_page}
<!-- $Id: users_list.htm 17053 2010-03-15 06:50:26Z sxc_shop $ -->
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}

<div class="form-div">
  <form action="javascript:searchUser()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
   <!-- &nbsp;{$lang.label_rank_name} <select name="user_rank"><option value="0">{$lang.all_option}</option>{html_options options=$user_ranks }</select>-->
    &nbsp;{$lang.label_pay_points_gt}&nbsp;<input type="text" name="pay_points_gt" size="8" />&nbsp;{$lang.label_pay_points_lt}&nbsp;<input type="text" name="pay_points_lt" size="10" />
    &nbsp;{$lang.label_user_name} &nbsp;<input type="text" name="keyword" />
       &nbsp;微信粉丝&nbsp;<select name="is_subscribe">
     <option value="">请选择</option>
     					<option value="1">已关注</option>
                        <option value="0">未关注</option>
                         </select>
    
     <input type="submit" value="{$lang.button_search}" />
  </form>
</div>

<form method="POST" action="" name="listForm" onsubmit="return confirm_bath()">

<!-- start users list -->
<div class="list-div" id="listDiv">
{/if}
<!--用户列表部分-->
<table cellpadding="3" cellspacing="1" class="un">
  <tr>
    <th>
      <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox">
      <a href="javascript:listTable.sort('user_id'); ">{$lang.record_id}</a>{$sort_user_id}
    </th>
    <th align="left"><a href="javascript:listTable.sort('user_name'); ">{$lang.username}</a>{$sort_user_name}</th>
    <th>一级下线</th>
    <th>二级下线</th>
    <th>三级下线</th>

    <th><a href="javascript:listTable.sort('user_money'); ">{$lang.user_money}</a>{$sort_user_money}</th>
    <th><a href="javascript:listTable.sort('pay_points'); ">{$lang.pay_points}</a>{$sort_pay_points}</th>
 

    <!-- <th>{$lang.pay_points}</th> -->
    <th><a href="javascript:listTable.sort('reg_time'); ">{$lang.reg_date}</a>{$sort_reg_time}</th>
    <th>{$lang.handler}</th>
  <tr>
  {foreach from=$user_list item=user}
  <tr>
    <td align="center"><input type="checkbox" name="checkboxes[]" value="{$user.user_id}" notice="{if $user.user_money ne 0}1{else}0{/if}"/>{$user.user_id}</td>
    <td class="first-cell">{if $user.is_subscribe eq 1}<span style="color:#F00;">[粉丝]</span>{/if}{$user.user_name|escape}[{if $user.uname}{$user.uname}{else}{$user.user_name|escape}{/if}]</td>
    <td align="center"><a href="users.php?act=list&pid={$user.user_id}&level=1">{$user.level_1_num}</a></td>
    <td align="center"><a href="users.php?act=list&pid={$user.user_id}&level=2">{$user.level_2_num}</a></td>
    <td align="center"><a href="users.php?act=list&pid={$user.user_id}&level=3">{$user.level_3_num}</a></td>
    <td align="center">{$user.user_money}</td>
	<td align="center">{$user.pay_points}</td>
   

    <!-- <td align="center">{$user.pay_points}</td> -->
    <td align="center">{$user.reg_time}</td>
    <td width="360" class="bnt_a">
      <a href="users.php?act=edit&id={$user.user_id}" title="{$lang.edit}">{$lang.edit}</a>
      <a href="users.php?act=address_list&id={$user.user_id}" title="{$lang.address_list}">{$lang.address_list}</a>
      <a href="order.php?act=list&user_id={$user.user_id}" title="{$lang.view_order}">{$lang.view_order}</a>
      <a href="account_log.php?act=list&user_id={$user.user_id}" title="{$lang.view_deposit}">{$lang.view_deposit}</a>
      <a href="javascript:confirm_redirect('{if $user.user_money ne 0}{$lang.still_accounts}{/if}{$lang.remove_confirm}', 'users.php?act=remove&id={$user.user_id}')" title="{$lang.remove}">{$lang.remove}</a>
    </td>
  </tr>
  {foreachelse}
  <tr><td class="no-records" colspan="7">{$lang.no_records}</td></tr>
  {/foreach}
  <tr>
      <td colspan="2">
      <input type="hidden" name="act" value="batch_remove" />
      <input type="submit" id="btnSubmit" value="{$lang.button_remove}" disabled="true" class="button" /></td>
      <td align="right" nowrap="true" colspan="8">
      {include file="page.htm"}
      </td>
  </tr>
</table>

{if $full_page}
</div>
<!-- end users list -->
</form>
<script type="text/javascript" language="JavaScript">
<!--
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}

{literal}
onload = function()
{
    document.forms['searchForm'].elements['keyword'].focus();
    // 开始检查订单
    startCheckOrder();
}


/**
 * 搜索用户
 */
function searchUser()
{
    listTable.filter['keywords'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
	listTable.filter['is_subscribe'] = Utils.trim(document.forms['searchForm'].elements['is_subscribe'].value);
	
    //listTable.filter['rank'] = document.forms['searchForm'].elements['user_rank'].value;
    listTable.filter['pay_points_gt'] = Utils.trim(document.forms['searchForm'].elements['pay_points_gt'].value);
    listTable.filter['pay_points_lt'] = Utils.trim(document.forms['searchForm'].elements['pay_points_lt'].value);
    listTable.filter['page'] = 1;
    listTable.loadList();
}

function confirm_bath()
{
  userItems = document.getElementsByName('checkboxes[]');

  cfm = '{$lang.list_remove_confirm}';

  for (i=0; userItems[i]; i++)
  {
    if (userItems[i].checked && userItems[i].notice == 1)
    {
      cfm = '{$lang.list_still_accounts}' + '{$lang.list_remove_confirm}';
      break;
    }
  }

  return confirm(cfm);
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}
{/if}